﻿//问题描述：.设计一个程序，输入10个数存入数组中，求最大值、最小值、平均值以及和.
// 输出：最大值。最小值。平均数。和。

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
 
namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            Console.WriteLine("Please input the 10 numbers:");
            double[] numbers = new double[10];
            double ave=0,max=0,min=0,sum=0;
            for (int i = 0; i < 10; i++)
            {
 
                string s=Console.ReadLine();
                numbers[i] = double.Parse(s);
                max=numbers[0];
                min=numbers[0];
            }
            for (int i = 0; i < 10; i++)
			{if (numbers[i]<min)
                {
                    min = numbers[i];
                }
                else if (numbers[i] > max)
                {
                    max = numbers[i];
                }
                ave += numbers[i];
                sum += numbers[i];
			}
            ave /= 10;
            Console.WriteLine("最大数为：{0}",max);
            Console.WriteLine("最小数为：{0}", min);
            Console.WriteLine("平均数为：{0}", ave);
            Console.WriteLine("和为：{0}", sum);            
            Console.ReadLine();
     
 
        }
    }
}

